<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>20-jQuery操作样式方法</title>
    <script src="jQuery/jquery-3.4.1.js"></script>
    <script>
         $(function () {
             //1.逐个设置
             $("div").css("width","100px");
             $("div").css("height","100px");
             $("div").css("background","red");

             //2.链式设置
             //注意点：如果链式超过3步，建议分开
             $("div").css("width","100px").css("height","100px").css("background","blue");

             //3.批量设置
             $("div").css({
                 width: "100px",
                 height: "200px",
                 background: "red"
             });

             //4.获取
             console.log($("div").css("width"));
         });
    </script>
</head>
<body>
<div></div>
</body>
</html>